1. Field of the Invention
The present invention relates to an optical encoder which is used for position measurement in a machine tool or a semiconductor manufacturing apparatus.
2. Description of the Prior Art
FIG. 1 is a perspective view of an example of a conventional optical encoder. The conventional optical encoder includes a first diffraction grating 1 (hereinafter referred to a "a first grating"), a second diffraction grating 2 (hereinafter referred to as "a second grating") disposed on the rear of the first grating in such a manner as to be movable relative to the first grating in directions indicated by the arrows, and a photoelectric conversion element 3 disposed on the rear of the second grating 2. The first and second gratings 1 and 2 each have a grating portion in which portions through which light is transmitted (hereinafter referred to as "light transmitting portions") and portions through which no light is transmitted (hereinafter referred to as "light non-transmitting portions") are alternately disposed at a predetermined distance (hereinafter referred to as "a grating pitch").
Parallel light ray L, which are incident on the first grating, pass through the first and second gratings 1 and 2, and are then made incident on the photoelectric conversion element 3. The photoelectric conversion element 3 converts the incident light into an electric signal corresponding to the intensity thereof and outputs that signal. This electric signal is a displacement signal obtained when the amounts of light which passes through the first and second gratings 1 and 2 change due to relative displacement of the first and second gratings 1 and 2. The period of the displacement signal is equal to the grating pitch. Although this displacement signal is supposed to be a triangular wave which is proportional to apparent changes of the light transmitting portions as viewed from the light emission side, which are caused by the overlapping of the first and second gratings 1 and 2, it is a false sine-wave signal in practical operations due to the light diffraction or the like. This false sine-wave is utilized as the displacement signal for position detection.
The distortion factor of the displacement signal obtained by the aforementioned conventional optical encoder changes greatly, as shown in FIG. 2, as the gap between the first and second gratings 1 and 2 changes. Variations in this distortion factor are mainly caused by a signal having a period which is a factor of 1/3 or 1/5 of that of the displacement signal (hereinafter referred to as "a third harmonic" or "a fifth harmonic") which is contained in the displacement signal. Thus, the position detection conducted by utilizing such a displacement signal generates errors. These errors may be reduced by fixing the gap between the first and second gratings 1 and 2. However, this requires a very high mounting accuracy.